// JavaScript Document
var adWidth="100px";
var adHeight="250px";
var adImg="images/ad1.jpg";
var close_img="images/close.png";

var adLeft=document.createElement("div");
adLeft.style.width=adWidth;
adLeft.style.height=adHeight;
adLeft.style.padding="0px";
adLeft.style.position="absolute";
adLeft.style.left="50px";
adLeft.style.top="20px";

var ad_img=document.createElement("img");
ad_img.src=adImg;
adLeft.appendChild(ad_img);

var closeimg=document.createElement("img");
closeimg.src=close_img;
closeimg.style.width="50px";
closeimg.style.position="relative";
closeimg.style.left="50px";
closeimg.style.top="-20px";
closeimg.style.cursor="pointer";
adLeft.appendChild(closeimg);

document.documentElement.appendChild(adLeft);

closeimg.addEventListener("click",function(){
	adLeft.style.display="none";
});

window.addEventListener("scroll",function(){
	var str2=document.documentElement.scrollTop||document.body.scrollTop;
	adLeft.style.top=(str2+20)+"px";
});